#!/bin/bash

(
    set -e 
    cd "$(dirname "$0")"


    image="inthbl/test_http_server"


    sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
    sudo docker buildx create --name multiarch-builder --driver docker-container --use || true
    sudo docker buildx inspect --bootstrap

    # echo "[INFO] build need about 7000 seconds ~= 2 hours "
    proj="src"
    sudo docker buildx build --push --platform=linux/amd64,linux/arm64,linux/arm/v7 \
      -f "$proj/Dockerfile" -t $image \
      "$proj"
    ## arg  --push : push to hub.  
    ##      sudo docker login

)



